using System;
using System.IO;

public sealed partial class DataTableProcessor
{
    
    
    private sealed class IntArrayProcessor : GenericDataProcessor<int[]>
    {
        public override bool IsSystem
        {
            get { return false; }
        }

     //   public override string TypeName => "IntArray";

        public override bool IsId { get; }

        public override string LanguageKeyword
        {
            get
            {
                return "int[]";
            }
        }
        public override string[] GetTypeStrings()
        {
            return new string[] {"int[]"};
        }

        public override void WriteToStream(DataTableProcessor dataTableProcessor, BinaryWriter binaryWriter, string value)
        {
            int[] xx = Parse(value);
            binaryWriter.Write(xx.Length);
            foreach (var x in xx)
            {
                binaryWriter.Write(x);   
            }
        }

        public override int[] Parse(string value)
        {
            var xx = value.Split(';');
            int[] ix = new int[xx.Length];
            for (int i = 0; i < xx.Length; i++)
            {
                ix[i] = int.Parse(xx[i]);
            }

            return ix;
        }
    }
}